//
//  ManyPeopleListenModel.m
//  NewMusic
//
//  Created by dllo on 15/11/12.
//  Copyright © 2015年 Going. All rights reserved.
//

#import "ManyPeopleListenModel.h"
#import "ListenDataModel.h"
@implementation ManyPeopleListenModel
-(instancetype)initWithDictionary:(NSDictionary *)dictionary {
    self = [super init];
    if (self) {
        self.actionDic = [NSDictionary dictionary];
        self.dataArray = [NSMutableArray array];
        [self setValuesForKeysWithDictionary:dictionary];
    }
    return self;
}
-(void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"id"]) {
        self.ID = [NSString stringWithFormat:@"%@", value];
    }else if ([key isEqualToString:@"data"]) {
        NSArray *array = (NSArray *)value;
        for (NSDictionary *dic  in array) {
                ListenDataModel * model = [[ListenDataModel alloc]initWithDictionary:dic];
                [self.dataArray addObject:model];
                [model release];
        }
    }else if ([key isEqualToString:@"action"]) {
        self.actionDic = [NSDictionary dictionaryWithDictionary:value];
    }
}
-(void)setValue:(id)value forKey:(NSString *)key {
    if ([key isEqualToString:@"style"]) {
        self.style = [NSString stringWithFormat:@"%@", value];
    }else {
        [super setValue:value forKey:key];
    }
}
@end
